package org.example.day01;

public class MyThread5 extends Thread{
    @Override
    public void run() {
        super.run();
        try {
            System.out.println("run begin");
            Thread.sleep(200000);
            System.out.println("run end");
        } catch (InterruptedException e) {
            System.out.println("在沉睡中被停止！" + this.isInterrupted());
            e.printStackTrace();
        }
    }

    public static void main(String[] args) {
        try {
            MyThread5 m5 = new MyThread5();
            m5.start();
            Thread.sleep(2000);
            m5.interrupt();
            System.out.println(m5.isInterrupted() + "999");
        } catch (InterruptedException e) {
            System.out.println("main catch");
            e.printStackTrace();
        }
        System.out.println("main end！");
    }
}
